<?php

/*
 * This file is part of the Qsnh/meedu.
 *
 * (c) 杭州白书科技有限公司
 */

namespace App\Services\Company\Models;

use App\Services\Member\Models\User;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class CompanyJoinRoleRecord extends Model
{
    use HasFactory;

    protected $table = 'company_join_role_records';

    protected $fillable = [
         'company_id','role_id', 'charge', 'started_at', 'expired_at','remark'
    ];

    public function user()
    {
        return $this->belongsTo(User::class, 'company_id');
    }
    public function company()
    {
        return $this->belongsTo(Company::class, 'company_id');
    }


    public function role()
    {
        return $this->belongsTo(CompanyRole::class, 'role_id');
    }
}
